package fpeas.function.math;

import fpeas.function.Function;

public class Doubles
{
	public static Function<Double,Double> abs(final Function<Double,Double> function)
	{
		return new Function<Double,Double>()
		{
			public Double run(final Double aDouble)
			{
				return Math.abs(function.run(aDouble));
			}
		};
	}

	public static Function<Double,Double> minus(final Function<Double,Double> function,final double takeThis)
	{
		return new Function<Double,Double>()
		{
			public Double run(final Double fromThis)
			{
				return function.run(fromThis)-takeThis;
			}
		};
	}

	public static Function<Double,Boolean> lessThan(final Function<Double,Double> function,final double upper)
	{
		return new Function<Double,Boolean>()
		{
			public Boolean run(final Double lower)
			{
				return function.run(lower)<upper;
			}
		};
	}
}